﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class MidLode : MonoBehaviour {
    public static string TargetSceneName;
	public static void LodeScene(string sceneName)
    {
        //先加载中间场景
        TargetSceneName = sceneName;
        SceneManager.LoadSceneAsync("a");
    }
    AsyncOperation asyncOperation;
    private Slider slider;

    private void Start()
    {
        slider = FindObjectOfType<Slider>();
        SceneManager.LoadSceneAsync(TargetSceneName);

    }
    private void Update()
    {
        slider.value = asyncOperation.progress;
    }
}
